//
//  GoodsCategoryController.m
//  LoveHappyShopping
//
//  Created by 白水非泉 on 16/6/23.
//  Copyright © 2016年 白水非泉. All rights reserved.
//

#import "GoodsCategoryController.h"
#import "GoodsCategeryModel.h"
@interface GoodsCategoryController ()

@end

@implementation GoodsCategoryController

- (void)viewDidLoad {
    [super viewDidLoad];
    [self setNavbar];
    [self showTheData];
    self.edgesForExtendedLayout=UIRectEdgeNone;
    // Do any additional setup after loading the view.
}
-(void)setNavbar{
    UIButton *btn=[[UIButton alloc]initWithFrame:CGRectMake(0, 0, 30, 30)];
    [btn setBackgroundImage:[UIImage imageNamed:@"btn_back"] forState:UIControlStateNormal];
    [btn addTarget:self action:@selector(backToForeView) forControlEvents:UIControlEventTouchUpInside];
    UIBarButtonItem *item=[[UIBarButtonItem alloc]initWithCustomView:btn];
    self.navigationItem.leftBarButtonItem=item;
    
}
-(void)backToForeView{
    [self.navigationController popViewControllerAnimated:YES];
    self.tabBarController.tabBar.hidden=NO;

}
-(void)showTheData{
    NSURL *url=[NSURL URLWithString:self.model.url];
    UIWebView *webView=[[UIWebView alloc]init];
    webView.backgroundColor=[UIColor whiteColor];
    NSURLRequest *request=[NSURLRequest requestWithURL:url];
    [webView loadRequest:request];
    self.view=webView;
    self.navigationItem.title=self.model.text;
    self.tabBarController.tabBar.hidden=YES;
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
